package com.mowh.gof23.behavioral.patterns.template.method;

/**
 * @author mowh1gd
 * @create 2023/10/20 14:19
 */
public abstract class AbstractDisplay {
    public abstract void open();
    public abstract void print();
    public abstract void close();
    public final void display() { //父类已实现功能逻辑，但具体细节需由子类完成。该功能逻辑不允许子类修改。
        open();
        for (int i = 0; i < 5; i++) {
            print();
        }
        close();
    }
}
